package eirkdbd.lab1.gui;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Label;
import java.io.IOException;
import java.io.InputStream;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class TitlePane extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9000L;

	private Image img;
	
	private static final String IMG_FILE = "/eirkdbd/lab1/gui/img/schemat.png";
	private static final String AUTHOR_FILE = "/eirkdbd/lab1/gui/img/Author.png";
	
	public TitlePane() {
		
		InputStream imgStream = this.getClass().getResourceAsStream(IMG_FILE);
		InputStream authorStream = this.getClass().getResourceAsStream(AUTHOR_FILE);
		
		JLabel jeden = new JLabel(" ");
		//jeden.setFont(new Font("Arial", Font.BOLD, 24));
		jeden.setForeground(Color.orange);
		add(jeden);
		setPreferredSize(new Dimension(200, 1));
		setBackground(Color.darkGray);		
		try {
			img = new ImageIcon(ImageIO.read(imgStream)).getImage();
		
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	   @Override
       protected void paintComponent(Graphics g) {
               super.paintComponent(g);
               g.drawImage(img, 40, 0, this);
             
       }
	
	
	
}